class Base1{
    public String name;
    public int age;

    //父类有参构造方法
    public Base1(String  name, int age) {
        this.name = name;
        this.age = age;
    }
    //父类无参构造方法
    public Base1(){
        System.out.println("父类无参构造方法！！");
    }
}
class Derived1 extends Base1 {
    String  name;
    int  age;
    public Derived1() {
        //子类构造方法中默认会调用基类的无参构造方法：super()
        super("wangwu",10);//这句代码可以省略，用户没写时，编译器会自动添加，而且super()必须时子类构
        //造方法中的第一条语句，并且只能出现一次
    }
    /*public Derived1(String  name, int age, String  name1, int age1) {
        super(name,age);
        this.name = name1;
        this.age = age1;
    }*/
    public void func(){
        System.out.println(super.name);
        System.out.println(super.age);
        System.out.println(name);
        System.out.println(age);
    }
}
public class Test {
    public static void main(String[] args) {
        Derived1 d = new Derived1() ;
        d.func() ;
    }
}
